package com.ruoyi.worker.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.worker.domain.RzAttendancePassRecord;
import com.ruoyi.worker.mapper.RzAttendancePassRecordMapper;
import com.ruoyi.worker.service.IRzAttendancePassRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 描述:
 *
 * @author 刘松山
 * @date 2022/1/17 14:35
 */
@Service
public class RzAttendancePassRecordServiceImpl implements IRzAttendancePassRecordService {
    @Autowired
    private RzAttendancePassRecordMapper rzAttendancePassRecordMapper;

    /**
     * 查询长期工通行记录
     *
     * @param staffName 长期工通行记录主键
     * @return 长期工通行记录
     */
    @Override
    public RzAttendancePassRecord selectRzAttendancePassRecordByStaffName(String staffName)
    {
        return rzAttendancePassRecordMapper.selectRzAttendancePassRecordByStaffName(staffName);
    }

    /**
     * 查询长期工通行记录列表
     *
     * @param rzAttendancePassRecord 长期工通行记录
     * @return 长期工通行记录
     */
    @Override
    public List<RzAttendancePassRecord> selectRzAttendancePassRecordList(RzAttendancePassRecord rzAttendancePassRecord)
    {
        return rzAttendancePassRecordMapper.selectRzAttendancePassRecordList(rzAttendancePassRecord);
    }

    /**
     * 新增长期工通行记录
     *
     * @param rzAttendancePassRecord 长期工通行记录
     * @return 结果
     */
    @Override
    public int insertRzAttendancePassRecord(RzAttendancePassRecord rzAttendancePassRecord)
    {
        rzAttendancePassRecord.setCreateTime(DateUtils.getNowDate());
        return rzAttendancePassRecordMapper.insertRzAttendancePassRecord(rzAttendancePassRecord);
    }

    /**
     * 修改长期工通行记录
     *
     * @param rzAttendancePassRecord 长期工通行记录
     * @return 结果
     */
    @Override
    public int updateRzAttendancePassRecord(RzAttendancePassRecord rzAttendancePassRecord)
    {
        return rzAttendancePassRecordMapper.updateRzAttendancePassRecord(rzAttendancePassRecord);
    }

    /**
     * 批量删除长期工通行记录
     *
     * @param staffNames 需要删除的长期工通行记录主键
     * @return 结果
     */
    @Override
    public int deleteRzAttendancePassRecordByStaffNames(String[] staffNames)
    {
        return rzAttendancePassRecordMapper.deleteRzAttendancePassRecordByStaffNames(staffNames);
    }

    /**
     * 删除长期工通行记录信息
     *
     * @param staffName 长期工通行记录主键
     * @return 结果
     */
    @Override
    public int deleteRzAttendancePassRecordByStaffName(String staffName)
    {
        return rzAttendancePassRecordMapper.deleteRzAttendancePassRecordByStaffName(staffName);
    }

}
